Skip to main content

All Questions

4votes
1answer
330views

Leetcode, longest palindromic substring

Here's a link Given a string s, return the longest palindromic substring in s. A string is called a palindrome string if the reverse of that string is the same as the original string. Example 1: ...
watch-this's user avatar
3votes
3answers
1kviews

The largest palindrome made from the product of two 3-digit numbers

Problem description: A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 × 99. Find the largest palindrome made from the ...
Amir Motefaker's user avatar
9votes
1answer
2kviews

LeetCode on Longest Palindromic Substring in Python

This is a programming question from LeetCode: Given a string s, return the longest palindromic substring in s. Example 1: Input: s = "babad" Output: "bab" Note: "aba" is ...
user avatar
4votes
4answers
1kviews

Check if a binary tree is symmetric in Python

I have solved the following Leetcode problem. Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center). For example, this binary tree [1,2,2,3,4,4,3] is symmetric....
user82261's user avatar
2votes
1answer
167views

How do I optimize memoization in order to find longest palindromic substring?

I want to find the longest palindromic substring using dynamic programming in Python3. The strings can be as large as this string. I have seen other questions on this problem that successfully solve ...
Aviral Srivastava's user avatar
3votes
1answer
282views

Project Euler - Problem No.4 - Largest palindrome product

according to the problem: A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 × 99. Find the largest palindrome made ...
Omri Shneor's user avatar
6votes
1answer
408views

Palindrome insertion challenge

Here is my solution to the following Daily Coding Problem challenge: Given a string, find the palindrome that can be made by inserting the fewest number of characters as possible anywhere in the word....
MrJoe's user avatar
  • 2,133
5votes
3answers
401views

Project Euler #4: palindromic number

The problem statement for Project Euler Problem 4 is as follows: A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 × 99. ...
arpster's user avatar
6votes
2answers
771views

Counting ways to divide a word into palindrome blocks

I wrote this program as a solution to the 2015 British Informatics Olympiad question on "block" palindromes. Brief overview of the task: A palindrome is a word that shows the same sequence ...
user avatar
1vote
1answer
676views

Project Euler #4 - Largest Palindrome Project - Python

I solved the HackerRank version of the Largest palindrome problem (similar to Project Euler 4) in Python: Find the largest palindrome made from the product of two 3-digit numbers which is less than ...
Aswin Mohan's user avatar
7votes
6answers
2kviews

Generalized Project Euler #4: Largest palindrome from product of two n-digit numbers in Python

This solves Project Euler 4: Largest palindrome product using Python (not limited to 3 digit numbers). I need suggestions for improvements to either the Python code or the math/algorithm since time of ...
Amey Dahale's user avatar
4votes
2answers
617views

Number of possible palindrome sequences

Here is the problem description from hackerearth.com: Rohan loves Palindromes. Palindrome is a string that read same forward and backward. For example abba is a ...
Shashank's user avatar
3votes
1answer
2kviews

Hackerrank Funny String python solution

"Funny String" problem from Hackerrank Suppose you have a String, \$S\$ of length \$N\$ indexed from \$0\$ to \$N-1\$. You also have some String, \$R\$, that is the reverse of \$S\$, where \$S\$ is ...
nyim's user avatar
6votes
1answer
889views

Palindromes that are sum of consecutive squares

I have been working on a Project Euler: 125, which took me ages to solve. The problem and source are cited below The palindromic number 595 is interesting because it can be written as the sum of ...
N3buchadnezzar's user avatar
3votes
2answers
400views

Largest palindrome product

From the Project Euler challenge series: A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 × 99. Find the largest ...
AJS's user avatar
  • 33

153050per page
close